<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <th:block th:include="include :: header('分润列表')" />
</head>
<body class="gray-bg">
     <div class="container-div">
        <div class="row">
            <div class="btn-group-sm" id="toolbar" role="group">
                <a class="btn btn-success" onclick="add()" shiro:hasPermission="gears_info:gears_info:add">
                    <i class="fa fa-plus"></i> 添加分润政策
                </a>
               <!-- <a class="btn btn-primary" onclick="dbfx()" shiro:hasPermission="gears_info:gears_info:add">
                    <i class="fa fa-edit"></i> 配置达标返现
                </a>-->
                <!--<a class="btn btn-info" onclick="$.operate.add()" shiro:hasPermission="gears_info:gears_info:add">
                    <i class="fa fa-download"></i> 配置分润标准
                </a>-->
                <!--<a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="gears_info:gears_info:add">
                    <i class="fa fa-plus"></i> 配置商户手续费
                </a>-->

               <!-- <a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="gears_info:gears_info:export">
                    <i class="fa fa-download"></i> 导出
                </a>-->
            </div>
            <div class="col-sm-12 select-table table-striped">
                <table id="bootstrap-table"></table>
            </div>
        </div>
    </div>
    <th:block th:include="include :: footer" />
    <script th:inline="javascript">
        var is_min = [[${@dict.getType('is_min')}]];
        var editFlag = [[${@permission.hasPermi('gears_info:gears_info:edit')}]];
        var removeFlag = [[${@permission.hasPermi('gears_info:gears_info:remove')}]];
        var prefix = ctx + "gears_info/gears_info";

        $(function() {
            var options = {
                url: prefix + "/list",
                createUrl: prefix + "/add",
                updateUrl: prefix + "/edit/{id}",
                removeUrl: prefix + "/remove",
                exportUrl: prefix + "/export",
                modalName: "服务商档位信息（分润标准）",
                columns: [
                {
                    field: 'grade',
                    title: '档次'
                },
                {
                    field: 'gradeName',
                    title: '档次名称'
                },
                {
                    field: 'paySection',
                    title: '月交易量区间'
                },
                {
                    field: 'updateDate',
                    title: '修改时间'
                },
                {
                    field: 'updateMan',
                    title: '修改人'
                },
                {
                    field: 'createDate',
                    title: '添加时间'
                },
                {
                    field: 'isMin',
                    title: '档位',
                    formatter: function (value, row, index) {
                        return $.table.selectDictLabel(is_min, value);
                    }
                },
                {
                    field: 'ds',
                    title: '消费DS'
                },
                {
                    field: 'ysf',
                    title: '云闪付'
                },
                {
                    field: 'reward',
                    title: '活动DS'
                },
                {
                    field: 'rewardYsf',
                    title: '云闪付活动DS'
                },
                {
                    field: 'rewardEndDate',
                    title: '活动DS到期日期'
                },
                {
                    field: 'addMan',
                    title: '添加人'
                },
                {
                    title: '操作',
                    align: 'center',
                    formatter: function(value, row, index) {
                        var actions = [];
                        actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.grade + '\',650,1000)"><i class="fa fa-edit"></i>编辑</a> ');
                        actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.grade + '\')"><i class="fa fa-remove"></i>删除</a>');
                        return actions.join('');
                    }
                }]
            };
            $.table.init(options);
        });


        /**
         * 前往配置档位政策页面
         */
        function add() {
            $.modal.open("添加分润政策",prefix + "/add",1000,650);
        }

        /**
         * 前往配置达标返现页面
         */
        function dbfx() {
            $.modal.open("配置达标返现",prefix + "/dbfx",800,400);
        }
    </script>
</body>
</html>